package cn.devices.mapper;

import cn.devices.entity.TbCodeGen;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 编号生成表 Mapper 接口
 * </p>
 *
 * @author 秋水浮萍
 * @since 2021-02-24
 */
@Repository
public interface TbCodeGenMapper  {

    @Select("select * from tb_code_gen where code_name=#{codeName} for update")
    TbCodeGen get(String code);

    @Update("update tb_code_gen set code_tm=#{codeTm}," +
            " code_value=#{codeValue} where code_name=#{codeName}")
    int update(TbCodeGen gen);

}
